/*
 * Copyright (C) 2023 Realtek Semiconductor Corp.
 * All Rights Reserved.
 *
 * This program is the proprietary software of Realtek Semiconductor
 * Corporation and/or its licensors, and only be used, duplicated,
 * modified or distributed under the authorized license from Realtek.
 *
 * ANY USE OF THE SOFTWARE OTHER THAN AS AUTHORIZED UNDER
 * THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
 *
 * Purpose : Definition of FTTR P2MP shared define
 */

#ifndef __OMCI_DM_FTTR_P2MP_H__
#define __OMCI_DM_FTTR_P2MP_H__

#ifdef __cplusplus
extern "C" {
#endif

/****************************************************************/
/* Include Files                                                */
/****************************************************************/


/****************************************************************/
/* Symbol Definition                                            */
/****************************************************************/
typedef enum omci_dm_fttr_cmd_e
{
    OMCI_DM_FTTR_CMD_GET_ONU_INFO_OP_STATE,//SUB Fttr Unit(65507)
    OMCI_DM_FTTR_CMD_GET_ONU_INFO_SN,
    OMCI_DM_FTTR_CMD_GET_ONU_INFO_FIBER_DISTANCE,
    OMCI_DM_FTTR_CMD_GET_ONU_INFO_MFU_RX_PWR,

    OMCI_DM_FTTR_CMD_GET_ONU_INFO_VENDOR_ID,//ONU-G(256)
    OMCI_DM_FTTR_CMD_GET_ONU_INFO_VERSION,

    OMCI_DM_FTTR_CMD_GET_ONU_INFO_VPCODE,//ONU2-G(257)
    OMCI_DM_FTTR_CMD_GET_ONU_INFO_EQT_ID,
    OMCI_DM_FTTR_CMD_GET_ONU_INFO_SYS_UP_TIME,

    OMCI_DM_FTTR_CMD_GET_ONU_INFO_SW_IMG,//Software image (7)

    OMCI_DM_FTTR_CMD_GET_OPTICAL_INFO,
 
    OMCI_DM_FTTR_CMD_END
}omci_dm_fttr_cmd_t;


typedef enum omci_dm_fttr_device_type_e
{
    OMCI_DM_FTTR_DEVICE_TYPE_MFU,
    OMCI_DM_FTTR_DEVICE_TYPE_SFU,
     
    OMCI_DM_FTTR_DEVICE_TYPE_END
}omci_dm_fttr_device_type_t;

typedef enum omci_dm_fttr_op_state_e
{
    OMCI_DM_FTTR_OP_STATE_EN    = 0,  
    OMCI_DM_FTTR_OP_STATE_DIS   = 1, 
}omci_dm_fttr_op_state_t;



#define OMCI_DM_FTTR_SN_LEN                 (8)
#define OMCI_DM_FTTR_VENDOR_ID_LEN          (4)
#define OMCI_DM_FTTR_VERSION_LEN            (14)
#define OMCI_DM_FTTR_SWIMAGE_VERSION_LEN    (14)
#define OMCI_DM_FTTR_EQTID_LEN              (20)




/****************************************************************/
/* Type Definition                                              */
/****************************************************************/

typedef struct omci_dm_fttr_onu_swimg_s
{
    uint16  entityId;
    char    swVersion[OMCI_DM_FTTR_SWIMAGE_VERSION_LEN+1];
    uint8   committed;
    uint8   active;
    uint8   valid;
}omci_dm_fttr_onu_swimg_t;

typedef struct omci_dm_fttr_onu_info_s
{
    uint16  mfuPortId;
    uint16  sfutId;
    uint8   opState;                                            //SUB Fttr Unit(65507) Operational state
    char    serialNum[OMCI_DM_FTTR_SN_LEN+1];                   //SUB Fttr Unit(65507) Serial Number
    uint16  fiberDistance;                                      //SUB Fttr Unit(65507) Fiber Distance
    double  mfuReceivedOpticalPwr;                              //SUB Fttr Unit(65507) MFU Received OpticalPower
    char    vendorID[OMCI_DM_FTTR_VENDOR_ID_LEN+1];             //ONU-G(256) Vendor ID
    char    version[OMCI_DM_FTTR_VERSION_LEN+1];                //ONU-G(256) Version
    uint16  VPCode;                                             //ONU2-G(257) Vendor product code
    char    EqtID[OMCI_DM_FTTR_EQTID_LEN+1];                    //ONU2-G(257) Equipment ID
    uint32  sysUpTime;                                          //ONU2-G(257) SysUpTime
    omci_dm_fttr_onu_swimg_t    swImg;                          //Software image(7) Version
}omci_dm_fttr_onu_info_t;  

/*DDMI*/
typedef struct omci_dm_fttr_optical_info_s
{
    omci_dm_fttr_device_type_t  devType;
    uint16                      mfuPortId;
    uint16                      sfutId;
    uint16                      Voltage; // unit: 100 uV
    uint16                      baisCurrent; // unit: 2uA
    double                      temperature; //unit: degrees (C)
    double                      rxPower; //unit: dbm
    double                      txPower; //unit: dbm
}omci_dm_fttr_optical_info_t;  



           


#ifdef __cplusplus
}
#endif

#endif
